diff options
| author | Adam Soltys <[email protected]> | 2026-01-27 09:47:26 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-01-27 09:47:26 -0800 |
| commit | c28b2c4d44f2aeff4e84f2627d76d1138b473bd3 (patch) | |
| tree | b9a4b06481ef2b3c93b2be76b9e693a1787e8cde /src/routes/(app)/reset/[code] | |
| parent | 99c159ae313dc6e791ae82cf937a0e29f110d97c (diff) | |
| download | coinos-ui-c28b2c4d44f2aeff4e84f2627d76d1138b473bd3.tar.gz coinos-ui-c28b2c4d44f2aeff4e84f2627d76d1138b473bd3.zip | |
fix captcha checks
Diffstat (limited to 'src/routes/(app)/reset/[code]')
| -rw-r--r-- | src/routes/(app)/reset/[code]/+page.svelte | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/routes/(app)/reset/[code]/+page.svelte b/src/routes/(app)/reset/[code]/+page.svelte index 755b7d19..ce43a79d 100644 --- a/src/routes/(app)/reset/[code]/+page.svelte +++ b/src/routes/(app)/reset/[code]/+page.svelte @@ -1,7 +1,7 @@ <script> import { PUBLIC_RECAPTCHA_SITE_KEY } from "$env/static/public"; import { browser } from "$app/environment"; - import { onDestroy, tick } from "svelte"; + import { onDestroy, onMount, tick } from "svelte"; import { t } from "$lib/translations"; import PasswordInput from "$comp/PasswordInput.svelte"; import Icon from "$comp/Icon.svelte"; @@ -15,7 +15,15 @@ let loading; let recaptchaToken = ""; let recaptchaSiteKey = PUBLIC_RECAPTCHA_SITE_KEY; - let isTor = $derived(browser && location.hostname.endsWith(".onion")); + let isTor = browser && location.hostname.endsWith(".onion"); + + onMount(() => { + if (!isTor && recaptchaSiteKey) { + let s = document.createElement("script"); + s.src = "https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey; + document.head.appendChild(s); + } + }); const getRecaptchaToken = () => new Promise((resolve, reject) => { @@ -60,14 +68,6 @@ }); </script> -{#if !isTor} -<svelte:head - ><script - src={"https://www.google.com/recaptcha/api.js?render=" + recaptchaSiteKey} - ></script></svelte:head -> -{/if} - <div class="pt-10"> <div class="w-[243px] mx-auto mb-10"> <a href="/"> |
